/*
 * @Author: 吴世扬 18368095041@163.com
 * @Date: 2024-05-10 16:06:38
 * @LastEditors: 吴世扬 18368095041@163.com
 * @LastEditTime: 2024-05-10 18:09:54
 * @FilePath: /data-center-web/src/utils/i18n.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// translate router.meta.title, be used in breadcrumb sidebar tagsview
import i18n from '@/lang/index';

export function translateRouteTitle(title: any) {
    // 判断是否存在国际化配置，如果没有原生返回
    // @ts-ignore
    const hasKey = i18n.global.te('route.' + title);
    if (hasKey) {
        const translatedTitle = i18n.global.t('route.' + title);
        return translatedTitle;
    }
    return title;
}
